const expressJoi = require('@escook/express-joi')
const Joi = require('joi')

const PASSWORD = Joi.string().pattern(/^[\S]{6,15}$/).required()
const USERNAME = Joi.string().alphanum().min(6).max(12).required()
const EMAIL = Joi.string().email().required()

// 用户验证规则
exports.userRegister = {
  // 2.1 校验 req.body 中的数据
  body: {
    username: USERNAME,
    password: PASSWORD,
    email: EMAIL
  },
}